package com.pvj.myaccount.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.pvj.myaccount.room.entity.Cost
import com.pvj.myaccount.room.entity.MonthCost

@Dao
interface CostDao {
    @Query("SELECT * FROM cost")
    fun getAll(): List<Cost>

    @Query("SELECT * FROM cost WHERE event_time >= :start AND event_time < :end")
    suspend fun findCostsTime(start: Long, end: Long): List<Cost>

//    @Query("SELECT * FROM cost WHERE id IN (:userIds)")
//    fun loadAllByIds(userIds: IntArray): List<Cost>
//
//    @Query("SELECT * FROM cost WHERE first_name LIKE :first AND " +
//            "last_name LIKE :last LIMIT 1")
//    fun findByName(first: String, last: String): Cost

    @Insert
    fun insert(vararg data: Cost)

    @Update
    fun update(data: Cost)
    @Delete
    fun delete(user: Cost)
}